// import Vue from 'vue'
// import Router from 'vue-router'
import index from '../views/index.vue'
import login from '../views/login.vue'
import register from '../views/register.vue'
import articleList from '../views/articleList.vue'
import articleAdd from '../views/articleAdd.vue'
import notFound from '../views/404.vue'

let routes = [
  {
    path: '/404',
    name: '404',
    hidden: true,
    component: notFound
  },
  {
    path: '/',
    component: index,
    name: '',
    // leaf: true,
    children: [
      { path: '/', component: articleList, name: '首页' },
      { path: '/article_add', component: articleAdd, name: '新增文章' }
    ]
  },
  {
    path: '/login',
    component: login,
    name: '登录'
  },
  {
    path: '/register',
    component: register,
    name: '注册'
  },
  {
    path: '*',
    hidden: true,
    redirect: { path: '/404' }
  }
]

export default routes
